<?php
class BlogSquareModel extends Model {	
	public function square()
	{
		// 推荐日志
		$map          = array();
		$map['isHot'] = 1;
        $map['status']= 1;
        $order        = 'rTime DESC';
		$data['relist'] = M('blog')->where( $map )->order( $order )->findAll();
		// 日志列表
		$field = '*';
        $map          = array();
        $map['private'] = array('neq',2);
        $map['status']= 1;
        switch( $_GET['order'] ) {
            case 'new':    //最新排行
                $order = 'cTime DESC';
                break;
            default:      //默认热门排行
                $order = 'hot DESC';
        }
		$data += M('blog')->field( $field )->where( $map )->order( $order )->findPage(20) ;
		return $data;
	}
}